/*
 * @Descripttion: 
 * @Author: junhuafly
 * @Date: 2020-03-04 10:33:36
 * @LastEditors: junhuafly
 * @Email: junhuafly@163.com
 * @LastEditTime: 2020-03-17 13:46:50
 */
// components/addresscell/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    edit: Boolean,
    useful: {
      type: Boolean,
      value:true
    },
    default: {
      type: Boolean,
      value: false
    },
    info:Object
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    editAddress(){
      const _this = this
      wx.navigateTo({
        url: '/pages/address/edit/index',
        events: {
          refreshAddress({data}){
            _this.triggerEvent('refreshAddress')
          }
        },
        success: (res) => {
          res.eventChannel.emit('addressInfo', { data: _this.data.info })
        },
        fail: ()=>{},
        complete: ()=>{}
      });
    }
  }
})
